let fs=require('fs');
let Mock=require('mockjs')

// 生成对象
let data=Mock.mock({
    "data|50":[{
        img:"@image(100x100,@color)",
        namr:"@cword(5,8)",
        price:"/\d{2,4}/",
        count:"/\d{2,4}/"
    }]
})
// 把数据写入json数据中
fs.writeFileSync('./data.json',JSON.stringify(data.data))